package hello;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Run {
    public static void main(String[] args) {
        String path = "applicationContext.xml";
        ApplicationContext context = new ClassPathXmlApplicationContext(path);

        MessageService messageService = (MessageService) context.getBean("messageService");
        System.out.println(messageService.getMessage());

        MessagePrinter messagePrinter = (MessagePrinter) context.getBean("messagePrinter");
        messagePrinter.printMessage();
    }
}
